package com.hua.designpattern.behavioral.observer.subscriber;

import java.util.Collection;

public abstract class PublisherAbstract {

	protected String message;

	protected Collection<SubscriberAbstract> subscribers;

	public abstract void addSubscriber(SubscriberAbstract subscriber);

	public abstract void removeSubscriber(SubscriberAbstract subscriber);

	public abstract void notityAllSubscriber();

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
		notityAllSubscriber();
	}

}
